﻿using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SudoForm
{
    class Initialization
    {
        public void initialzation(string type)
        {
            for (int line = 1; line < 10; line++)
            {
                for (int col = 1; col < 10; col++)
                {
                    if (type == "TaxtBox")
                    {
                        mainForm form = new mainForm();
                        TextBox textBox = new TextBox();
                        form.panel1.Controls.Add(textBox);//修改了panel1的访问范围
                        textBox.Location = new System.Drawing.Point(8 + 30 * line, 8 + 30 * col);//显示位置
                        textBox.Size = new System.Drawing.Size(30, 30);//输入框大小
                        textBox.Name = line.ToString() + "-" + col.ToString();//输入框名字
                    }
                    else
                    {
                        AnswerForm form = new AnswerForm();
                        Label label = new Label();
                        form.panel1.Controls.Add(label);//修改了panel1的访问范围
                        label.Location = new System.Drawing.Point(8 + 30 * line, 8 + 30 * col);
                        label.Size = new System.Drawing.Size(30, 30);
                        label.Name = line.ToString() + "-" + col.ToString();
                    }
                    
                }
            }
        }

    }
}
